# Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>
# Modified from extra/xdg-desktop-portal-kde; original contributors:
# Contributor: Antonio Rojas <arojas@archlinux.org>

pkgname=xdg-desktop-portal-lxqt
pkgver=0.5.0
pkgrel=1
pkgdesc='A backend implementation for xdg-desktop-portal using Qt/KF5/libfm-qt'
arch=(loong64 x86_64)
groups=(lxqt)
url='https://github.com/lxqt/xdg-desktop-portal-lxqt'
license=(LGPL)
depends=(qt5-base kwindowsystem5 xdg-desktop-portal libfm-qt)
makedepends=(cmake)
provides=(xdg-desktop-portal-impl)
source=("https://github.com/lxqt/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.xz"{,.asc}
        lxqt-portals.conf)
sha256sums=('43f76255cfe57e8b5df88af71f20e36bc1d3b89f4b39771ad443b0215b57e796'
            'SKIP'
            '867b15caa72e2a85d2ef566cce9f35d8cdea9ed181fbb0290e5ab50e18a8d4aa')
validpgpkeys=(
  "19DFDF3A579BD509DBB572D8BE793007AD22DF7E"  # Pedram Pourang <tsujan2000@gmail.com>
)

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  # fix detection with x-d-p 1.18
  install -Dm644 ${srcdir}/lxqt-portals.conf  ${pkgdir}/usr/share/xdg-desktop-portal/lxqt-portals.conf

}
